package fi.foyt.cs.persistence.domainmodel.oauth;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import com.google.appengine.api.datastore.Key;

@Entity
@Cacheable
public class AuthenticatedUserToken {

  public Key getId() {
    return id;
  }

  public Long getAuthenticatedUserId() {
    return authenticatedUserId;
  }
  
  public void setAuthenticatedUserId(Long authenticatedUserId) {
    this.authenticatedUserId = authenticatedUserId;
  }
  
  public String getToken() {
    return token;
  }

  public void setToken(String token) {
    this.token = token;
  }

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Key id;

  @Column (nullable = false)
  private Long authenticatedUserId;
  
  @Column (nullable = false)
  private String token;
}